<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>object2.html</title>
<script>
function Member(mid, irum){
	this.mid=mid;
	this.irum=irum;
	this.toString=function(){
		console.log(this.mid+'   '+this.irum);
		
	}
}
var array = new Array();

var sBtn, oBtn;

window.onload= function(){
	sBtn= document.getElementById('btnSave');
	oBtn= document.getElementById('btnOutput');
	
	sBtn.onclick=saveFunc;
	oBtn.onclick=outputFunc;
	
}

function saveFunc(){
	//아이디와 성명을 객체에 저장하여 배열에 추가.
	
	//console.log('save','zzzz');
	
	
	m= new Member(frm.mid.value,frm.irum.value);
	array.push(m);
	
}

function outputFunc(){
	//console.log('output','zzzzz');
	for(i=0;i<array.length; i++){
		array[i].toString();
	}
}

</script>


</head>
<body>
<h3>성적을 입력하세요.</h3>
<form name='frm' action='' method='post'>
<li><label> 아이디</label><input type='search' name='mid'>
<li><label> 성명</label><input type='search' name='irum'>
<p/>

<input type='button' value='Save' id='btnSave'>
<input type='button' value='OUTPUT' id='btnOutput'>


</form>


</body>
</html>